Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-29838 Add false sharing test case #17515

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

richardkchapman
Copy link
Member

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@github-actions
Copy link

@mckellyln
Copy link
Contributor

mckellyln commented Jun 29, 2023

Do you get results similar to this ?
20:52:51.083809 2699800 Same RAs took 6105ms
20:52:57.159401 2699800 Adjacent RAs took 6078ms
20:53:01.858301 2699800 Spaced RAs took 4701ms
I don't have a dual-socket machine to see if any addl CC effect.

This might actually hide some sharing effects due to a lock xadd instruction ?

@richardkchapman
Copy link
Member Author

My results were (on a debug build)

16:23:28.297867 259 Specified library location sdf not found
16:23:28.303840 259 Including test RelaxedAtomicTest
.16:23:35.381542 259 Same RAs took 7079ms
16:23:41.804022 259 Adjacent RAs took 6423ms
16:23:43.106215 259 Spaced RAs took 1302ms

using a 3.6 GHz 8-Core Intel Core i9 (not dual-socket)

Copy link
Contributor

@mckellyln mckellyln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.
Perhaps also interesting if near and far non-atomic increment were added as well.

@ghalliday
Copy link
Member

@richardkchapman I haven't merged because you were making other changes (e.g. local reference within the callbacks). Let me know if you want me to merge as-is.

@GordonSmith
Copy link
Member

@richardkchapman let me know if your happy for it be merged (I will take Gavins comment as an approval!).

RelaxedAtomic<unsigned> retriesIgnoredSec;
RelaxedAtomic<unsigned> retriesNeeded;
RelaxedAtomic<unsigned> retriesReceivedPrm;
RelaxedAtomic<unsigned> retriesIgnoredPrm __attribute__((aligned(CACHE_LINE_SIZE)));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should probably not be included

@@ -51,7 +51,7 @@ auto sub_fetch(T & value, decltype(value.load()) delta, std::memory_order order
//NOTE: Counts will never be lost, but the values read from another thread may be inconsistent.
//E.g., thread 1 updates x than y, thread 2 may read an updated value of y, but an old value of x.
template <typename T>
class RelaxedAtomic : public std::atomic<T>
class alignas(CACHE_LINE_SIZE) RelaxedAtomic : public std::atomic<T>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nor this one

@richardkchapman
Copy link
Member Author

I removed a couple of changes that should not really have been included. As far as I am concerned it's now ok to merge, but not in any way urgent.

@GordonSmith
Copy link
Member

@mckellyln can you re-review latest changes?

Copy link
Contributor

@mckellyln mckellyln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this PR except I think the java changes are not related and perhaps would go away with a rebase ?

@richardkchapman
Copy link
Member Author

@mckellyln I have repushed to remove the unwanted Java changes

@GordonSmith GordonSmith merged commit d0d371c into hpcc-systems:master Jul 27, 2023
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants